<?php $this->renderPartial('_tabs'); ?>
<div class="grid_16">
	<div class="grid-filter-menu">
		<?php $this->widget('zii.widgets.CMenu', array('items' => $typesLinks)); ?>
	</div>
</div>
<div class="grid_16 relative">
    <div class="manage-advertisements form">
		<?php
		$this->widget('PsGridView', array(
			'id' => 'manage-advertisements-grid',
			'dataProvider' => $dataProvider,
			'filter' => $advertisement,
			'template' => '{pager}{pagesize}{items}',
			'pagerCssClass' => 'pager float-right',
			'pagesizeCssClass' => 'pager-pagesize',
			'htmlOptions' => array(
				'class' => 'grid-view no-shadow'
			),
			'rowCssClassExpression' => '($row % 2 == 0 ? "even" : "odd")',
			'columns' => array(
				array(
					'header' => 'Advertisement Message',
					'name' => 'ad_message',
					'htmlOptions' => array('width' => '360px'),
				),
				array(
					'header' => 'Ad Type',
					'name' => 'ad_type_code',
					'htmlOptions' => array('width' => '80px'),
				),
				array(
					'header' => 'Score',
					'name' => 'rejection_score',
					'value' => '$data->rejection_score',
					'filter' => false,
					'htmlOptions' => array(
						'width' => '130px',
						'class' => 'ad-approval-score'
						),
				),
				array(
					'header' => 'Launch Date',
					'name' => 'launch_date',
					'value' => 'Yii::app()->dateFormatter->formatDateTime(strtotime($data->launch_date), "short", null)',
					'filter' => false,
					'htmlOptions' => array('width' => '80px'),
				),
				array(
					'header' => 'Approval Status',
					'name' => 'approval_status',
					'type' => 'raw',
//						'filter' => Advertisement::getApprovalStatusListData(),
					'filter' => false,
					'value' => 'CHtml::tag("span", array("class" => "ad-approval-status " . str_replace(" ", "-", strtolower($data->getApprovalStatus()))), $data->getApprovalStatus())',
					'htmlOptions' => array('width' => '100px')
				),
				array(
					'header' => 'Submitted By',
					'name' => 'user_name',
					'type' => 'raw',
					'value' => '$data->user->name',
					'htmlOptions' => array('width' => '130px'),
				),
				array(
					'header' => 'Remarks',
					'name' => 'status_remarks',
					'htmlOptions' => array('width' => '140px'),
				),
				array(
					'header' => 'Actions',
					'class' => 'common.widgets.grid.PsActionColumn', // protected/components/PsActionColumn.php
					'htmlOptions' => array(
						'class' => 'action-column',
						'width' => '80px'
					),
					'options' => array(
						'width' => 150
					),
					'actions' => array(
						'approve' => array(
							'label' => 'Approve / Reject',
							'icon' => '/images/icons/farmfresh/16x16/layout_edit.png',
							'class' => 'adfilter',
							'url' => array('/adsControl/review', 'id' => '$data->id'),
						)
					)
				)
			)
		));
		?>
    </div>
</div>